<template>
  <div>登录</div>
</template>

<script type="text/ecmascript-6">
import { Toast } from "vant";
import { defineComponent } from "vue";
import router from "../../router";
import { post } from "../../untils/request";

export default defineComponent({
  setup() {
    function login() {
      post("/portal", {
        loading: true,
        module: "Account",
        interface: "1000",
        data: {
          account: "17754256887",
        password: "a123456",
        },
      }).then((res) => {
        Toast("登录成功");
        setTimeout(() => {
          router.push("/");
          localStorage.setItem("token", res.data.accessToken);
        }, 1000);
      });
    }
    login();

    return {
      login,
    };
  },
});
</script>

<style scoped lang="less">
</style>